﻿<html>
  <head>
  <title>Sciter 帮助</title>
  <style>
    @import url(styles/main.css);
    @import url(styles/lib_search.css);
  </style>
  <script type="text/tiscript">
    include "scripts/toc.tis";
    include "scripts/indexer.tis";
    include "scripts/lib_search.tis";
    var back      = self.$(toolbar>button.back);
    var forward   = self.$(toolbar>button.forward);
    var frameset  = self.$(frameset#body);
    var contentFrame = self.$(frame#content);
    var toc = self.$(#toc);
    var firstLoad = true;
    back.onClick    = :: frameset.goBack();  
    forward.onClick = :: frameset.goForward();  

    function generateToc()
    {
      var cbody = contentFrame[0] && contentFrame[0].$(body);
      if( cbody ) makeToc(cbody,toc);
      else toc.clear();
    }
    
    event historyStateChange 
    {
      back.state.disabled = !frameset.canGoBack();
      forward.state.disabled = !frameset.canGoForward();
      generateToc();
    }

    contentFrame << event complete
    {
      if (firstLoad) {
        firstLoad = false;
        generateToc();
      }
      if(afterTocEvent) afterTocEvent();
      afterTocEvent = null;
	  }

    contentFrame << event ~click $(a[href^="http"]) (evt)
    {
      Sciter.launch(evt.target.@["href"]); // show external URLs in system browser.
      return true;
    }
    
	var afterTocEvent;
	function GoToPage(pageurl, toc_entry)
	{
		contentFrame.load(pageurl);
		afterTocEvent = function() {
			goTocSection(toc_entry);
		};
	}
	
	View.SciterDocsGoToPage = GoToPage;
  </script>
  </head>
  <body>
  <toolbar>
    <button accesskey="LEFT" .back disabled title="Go backward" />
    <button accesskey="RIGHT" .forward disabled title="Go forward" />
  </toolbar>
  <frameset #body history>
    <div #index >
      <include src="help-index.htm">
        help-index.htm not found!  
      </include>
    </div>
    <splitter/>
    <frame .search_target #content src="" src="content/preface.htm" content-style="styles/content.css"/>
    <splitter/>    
    <div #toc />
  </frameset>
  </body>
</html>
